package cn.pet.service.manage.service.impl;

import cn.pet.service.manage.entity.PetOrder;
import cn.pet.service.manage.entity.dto.OrderSearch;
import cn.pet.service.manage.entity.vo.OrderList;
import cn.pet.service.manage.entity.vo.OrderVO;
import cn.pet.service.manage.mapper.PetOrderMapper;
import cn.pet.service.manage.service.PetOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 订单表 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-02-11
 */
@Service
public class PetOrderServiceImpl extends ServiceImpl<PetOrderMapper, PetOrder> implements PetOrderService {

    @Resource
    private PetOrderMapper petOrderMapper;

    @Override
    public OrderVO detailById(String id) {
        return petOrderMapper.queryById(id);
    }

    @Override
    public List<OrderList> listByPage(OrderSearch search) {
        PageHelper.startPage(search.getPageNum(),search.getPageSize());
        return this.baseMapper.queryList(search);
    }

    @Override
    public List<OrderList> listByUserId(OrderSearch search) {
        return this.baseMapper.queryList(search);
    }


}
